<?php

namespace App\Vilidate;

/**
 * user控制器下的验证规则类
 */
class PlayletController
{
    public $index = ['rule'=>[], 'msg'=>[]];

    public $episodesIndex = ['rule'=>[], 'msg'=>[]];

    public $batchUpload = [
        'rule'=>[
            'videos' => 'required|array',
        ],
        'msg'=>[
            'videos.required' => '视频不能为空',
            'videos.array' => '视频应为数组',
        ]
    ];

    public $view = ['rule'=>[], 'msg'=>[]];

    public $delete = ['rule'=>[], 'msg'=>[]];

    public $episodesList = ['rule'=>[], 'msg'=>[]];

    public $create = [
        'rule'=>[
            'name' => 'required|string',
            'introduction' => 'required|string',
            'price' => 'required|string',
            'cover' => 'required|string',
            'status' => 'required',
        ],
        'msg'=>[
            'name.required' => '名称不能为空',
            'introduction.string' => '剧集简介为字符串',
            'introduction.required' => '剧集简介不能为空',
            'price.string' => '剧集售价为字符串',
            'price.required' => '剧集售价不能为空',
            'cover.required' => '剧集头像不能为空',
            'status.required' => '状态不能为空',
        ]
    ];

    public $update = [
        'rule'=>[
            'name' => 'required|string',
            'introduction' => 'required|string',
            'price' => 'required|string',
            'cover' => 'required|string',
            'status' => 'required',
        ],
        'msg'=>[
            'name.required' => '名称不能为空',
            'introduction.string' => '剧集简介为字符串',
            'introduction.required' => '剧集简介不能为空',
            'price.string' => '剧集售价为字符串',
            'price.required' => '剧集售价不能为空',
            'cover.required' => '剧集头像不能为空',
            'status.required' => '状态不能为空',
        ]
    ];

    public $tag = [
        'rule'=>[
            'tag_ids' => 'required|array',
        ],
        'msg'=>[
            'tag_ids.required' => '标签不能为空',
            'tag_ids.array' => '标签不能应为数组'
        ]
    ];
}